package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.horizontalcard.api.card.BaseHorizontalItemCard;
import com.huawei.appmarket.service.store.awk.bean.HorizontalBigImageItemBean;
import com.huawei.appmarket.support.video.VideoPlayer;
import o.cgz;
import o.chc;
import o.Logger;
import o.dof;
import o.ContentManager;
import o.epv;
import o.eqx;
import o.evp.b;
import o.evt;
import o.ewm.d;
import o.ewm.h;
import o.ewm.j;

public class HorizontalVideoItemCard extends BaseHorizontalItemCard {
    public LinearLayout ʻ;
    private TextView ʽ;
    public VideoPlayer ˋ;
    private TextView ॱॱ;

    public HorizontalVideoItemCard(Context context) {
        super(context);
    }

    public static int ʼ() {
        return chc.ʻॱ();
    }

    public cgz ˏ(View view) {
        this.ˋ = (VideoPlayer) view.findViewById(j.ˊʴ);
        this.ॱॱ = (TextView) view.findViewById(j.ˉﾟ);
        this.ʽ = (TextView) view.findViewById(j.ㆍʼ);
        this.ʻ = (LinearLayout) view.findViewById(j.ᐝʼ);
        ʽ(view);
        ʻ();
        return this;
    }

    public void ʻ() {
        int ˎ = epv.ˎ(this.ʼॱ, ʼ(), chc.ˋ());
        this.ˋ.setLayoutParams(new LayoutParams(ˎ, (int) (((float) ˎ) * epv.ʼ())));
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof HorizontalBigImageItemBean) {
            HorizontalBigImageItemBean horizontalBigImageItemBean = (HorizontalBigImageItemBean) cardBean;
            if (Logger.ˎ()) {
                Logger.ˏ("HorizontalVideoItemCard", "bean.getVideoUrl_()=" + horizontalBigImageItemBean.ॱꜟ());
            }
            if (horizontalBigImageItemBean.ʽᐝ() != null) {
                this.ॱॱ.setText(horizontalBigImageItemBean.ʽᐝ());
            }
            int i = j.ʿˈ;
            int i2 = j.ʿʿ;
            String str = (String) this.ॱॱ.getTag(i);
            String str2 = (String) this.ॱॱ.getTag(i2);
            if (!dof.ˋ(str) && str.equals(horizontalBigImageItemBean.ॱꜟ())) {
                return;
            }
            if (dof.ˋ(str2) || !str2.equals(horizontalBigImageItemBean.ॱﾞ())) {
                str = horizontalBigImageItemBean.ॱﾞ();
                str2 = horizontalBigImageItemBean.ॱꜟ();
                this.ॱॱ.setTag(i, str2);
                this.ॱॱ.setTag(i2, str);
                if (this.ˋ != null) {
                    this.ˋ.setVideoBaseInfo(new b().ˎ(horizontalBigImageItemBean.ॱꞌ()).ˊ(str).ˋ(str2).ˏ(horizontalBigImageItemBean.ͺˏ()).ॱ(horizontalBigImageItemBean.u_()).ʼ(horizontalBigImageItemBean.ᐧॱ()).ᐝ(horizontalBigImageItemBean.ᐝʽ()).ʻ(evt.ˏ(horizontalBigImageItemBean.sp_)).ॱॱ(horizontalBigImageItemBean.ॱـ()).ॱ());
                    Context ˋ = ContentManager.getInstant().getContext();
                    eqx.ˋ(ˋ.getResources().getDimensionPixelSize(d.ॱʽ), ˋ.getResources().getDimensionPixelSize(d.ॱʼ), this.ˋ.ॱॱ(), str);
                }
                ˋ(this.ʽ, horizontalBigImageItemBean.ˋʻ());
            }
        }
    }

    public int ˊ() {
        return h.ˏˍ;
    }

    public int ˎ() {
        return h.ˏˍ;
    }
}
